/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package radio_station7.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *
 * @author ebababi
 */
@Entity
@DiscriminatorValue("Band")
public class BandAlbum extends Album implements Serializable {
    private static final long serialVersionUID = 1L;
    @JoinColumn(name = "BAND_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Band bandId;

    public BandAlbum() {
    }

    public BandAlbum(Long id) {
        this.id = id;
    }

    public BandAlbum(Long id, String title, Date releaseDate, String format, int diskNumber) {
        this.id = id;
        this.title = title;
        this.releaseDate = releaseDate;
        this.format = format;
        this.diskNumber = diskNumber;
    }

    public Band getBandId() {
        return bandId;
    }

    public void setBandId(Band bandId) {
        Band oldBandId = this.bandId;
        this.bandId = bandId;
        changeSupport.firePropertyChange("bandId", oldBandId, bandId);
    }

}
